package smartcampus.scjava.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import smartcampus.scjava.POJO.DO.Tuition;
import smartcampus.scjava.mapper.TuitionFeeMapper;
import smartcampus.scjava.service.TuitionService;
import smartcampus.scjava.mapper.TuitionMapper;
import org.springframework.stereotype.Service;

/**
* @author 苟森
* @description 针对表【tuition(学费缴纳中间表，存储学号和该学号对应的学费类型id)】的数据库操作Service实现
* @createDate 2023-12-12 09:09:01
*/
@Service
public class TuitionServiceImpl extends ServiceImpl<TuitionMapper, Tuition>
    implements TuitionService{
    @Autowired
    TuitionMapper tuitionMapper;
    @Override
    public Boolean addTuition(Tuition tuition) {
        String Typeid = tuition.getTypeid();
        String Stuid = tuition.getStuid();
        //默认未缴纳  0：未缴纳，  1：缴纳完毕
        tuition.setIsDelete(0);
        int isDelete = tuition.getIsDelete();
        System.out.println(tuition);
        return tuitionMapper.addTuition(Stuid,Typeid,isDelete);
    }

    @Override
    public Boolean updateisDelete(Tuition tuition) {
       return tuitionMapper.updateisDelete(tuition);
    }
}




